import { RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';

import { PagesComponent } from './pages.component';
import { NotFoundComponent } from './exception/not-found/not-found.component';

const routes: Routes = [
  {
    path: '',
    component: PagesComponent,
    children: [
      {
        path: 'list',
        loadChildren: './list/list.module#ListModule',
      },
      {
        path: 'learn',
        loadChildren: './learn/learn.module#LearnModule',
      },
      {
        path: 'animations',
        loadChildren: './animations/animations.module#AnimationsModule',
      },
      {
        path: 'cpts',
        loadChildren: './cpts/cpts.module#CptsModule',
      },
      {
        path: 'exception',
        loadChildren: './exception/exception.module#ExceptionModule',
      },
      {
        path: '',
        redirectTo: 'list',
        pathMatch: 'full',
      },
      {
        path: '**',
        component: NotFoundComponent,
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class PagesRoutingModule {}
